<?php
/**
 * Configuration class for all the configuration entries that need to be checked
 *
 * @author zonk
 */
class Config {

        /**
         * PDO handle
         * @var PDO
         */
        private static $conn;

        /**
         * The connection string for the database
         * @var string
         */
        private static $connect_string = 'mysql:host=localhost;dbname=pmldb';

        /**
         * The user which is used to connect to the database
         * @var string
         */
        private static $username = 'root';

        /**
         * The password for the given user
         * @var string
         */
        private static $password = '';

        /**
         * Returns a connection to be used to make SQL-statements
         * @return PDO
         */
        public static function getConnection(){
                Config::$conn = new PDO(Config::$connect_string, Config::$username, Config::$password);
                Config::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
                return Config::$conn;
        }

        public static function getLastInsertedId($string){
                return Config::$conn->lastInsertId();
        }

}
?>